<template>
  <div class="p-3">
    <el-card>
      <div class="w-full flex justify-between">
        <div>
          <el-button type="info" @click="callback">{{ $t('mess.messInfo.446136-0') }}</el-button>
        </div>
        <div>
          <el-button type="primary" @click="tableRef.getListData()">{{ $t('mess.messInfo.446136-1') }}</el-button>
        </div>
      </div>
    </el-card>
    <el-card class="mt-3">
      <custom-table
        ref="tableRef"
        height="660px"
        max-height="660px"
        :prop-list="tableInfoBaseConfig"
        select-key="id"
        :req-request="reqRequest"
        :props-search-form="searchForm"
        :cellStyle="cellStyle"
        :operate-flag="false"
        :disable-ids="[]"
        :role-config="['wallet:recharge-history:query', 'home:wallet:recharge-history:query']"
        :expend-visible="false"
      >
        <template #key="{ row }">
          <div class="flex justify-center items-center">
            {{ row.countryCode }}{{ row.key }}
          </div>
        </template>
        <template #valueHeader>
          <div class="text-left">内容</div>
        </template>
        <template #status="{ row }">
          <div class="w-full flex justify-center items-center">
            <el-tag v-if="row.status === 'SUCCESS'" type="primary">{{ $t('mess.config.510061-3') }}</el-tag>
            <el-tag v-if="row.status === 'FAIL'" type="danger">{{ $t('mess.config.510061-4') }}</el-tag>
            <el-tag v-if="row.status === 'INIT'" type="warning">{{ $t('mess.config.510061-5') }}</el-tag>
          </div>
        </template>
      </custom-table>
    </el-card>
  </div>
</template>

<script setup>
import customTable from '@/components/customTable'
import { cellStyle, itemStyle, searchInfoBaseConfig, statusList, tableInfoBaseConfig } from "./config.js";
import {deepClone, selectDictLabel} from "@/utils/setting.js"
import useI18n from '@/i18n'

const { t } = useI18n.global
const route = inject('route')
const reqRequest = ref({
  url: `/tsk/taskData/list/${route.value.params.id}`,
  methods: 'get'
})

const queryData = ref(deepClone(route.value.params))
const searchForm = ref({
  pageSize: 100
})

const tableRef = ref()

// 返回
const callback = () => {
  route.value = { path: '/mess', meta: { title: 'src.App.054912-0' }, params: {} }
}
</script>

<style scoped lang="scss">

</style>